package com.mohan;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

public class TestTest {
    public static void main(String[] args) {
        Hello hello = new Hello();
        Person person = new Person(1, "10000");
        hello.setPerson(person);
        System.out.println("person = " + person);
    }
}

@Data
@AllArgsConstructor
@NoArgsConstructor
class Person {
    private Integer id;
    private String name;
}

class Hello{

    public void setPerson(Person person) {
        person.setName("nana");
        person = new Person(2,"mohan");

        System.out.println("person = " + person);
    }
}
